package com.ruoyix.im.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyix.common.core.domain.PageQuery;
import com.ruoyix.common.core.domain.R;
import com.ruoyix.common.core.page.TableDataInfo;
import com.ruoyix.im.domain.ImChatUserMessage;
import com.ruoyix.im.domain.bo.ImChatUserMessageBo;
import com.ruoyix.im.domain.vo.ImChatUserMessageVo;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 单聊记录Service接口
 *
 * @author ruoyi
 * @date 2024-05-27
 */
public interface IImChatUserMessageService extends IService<ImChatUserMessage> {

    /**
     * 查询单聊记录
     */
    ImChatUserMessageVo queryById(Long id);

    /**
     * 查询单聊记录列表
     */
    TableDataInfo<ImChatUserMessageVo> queryPageList(ImChatUserMessageBo bo, PageQuery pageQuery);

    /**
     * 查询单聊记录列表
     */
    List<ImChatUserMessageVo> queryList(ImChatUserMessageBo bo);

    /**
     * 新增单聊记录
     */
    Boolean insertByBo(ImChatUserMessageBo bo);

    /**
     * 修改单聊记录
     */
    Boolean updateByBo(ImChatUserMessageBo bo);

    /**
     * 校验并批量删除单聊记录信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    public R<Page> listSystemMessage(Long current, Long size);

    public void saveSystemMessage(String content);

    public R<Page> listFriendMessage(Long current, Long size, Long friendId);


    public Map<Long, List<ImChatUserMessageVo>> getChatUserMessageListByUserId(Long userId);

    public void setMessageRead(Long fromId,Long toId);
}
